package minidb.sqlexec;

import minidb.drive.*;
import minidb.parse.exps.*;
import minidb.parse.exps.DropExp.DropType;

public class DropExecutor implements IExecutor
{
	private String name;
	private DropType dType;
	
	public DropExecutor(DropExp e)
	{
		this.name=e.name;
		this.dType=e.dType;
	}

	@Override
	public void Execute() throws FileOpException
	{
		switch(this.dType)
		{
			case TABLE:
				TableOp tableOp=new TableOp();
				tableOp.DropTable(this.name);
				break;
			case INDEX:
				IndexOp indexOp=new IndexOp();
				indexOp.DropIndex(this.name);
				break;
			case VIEW:
				break;
		}
	}
}
